package com.sky.controller.user;

import com.sky.dto.OrdersDTO;
import com.sky.dto.OrdersSubmitDTO;
import com.sky.result.Result;
import com.sky.service.OrederService;
import com.sky.vo.OrderSubmitVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/user/order")
@RestController
public class OrderController {

    @Autowired
    private OrederService orederService;

    /**
     * 提交订单
     * @return
     */
    @ApiOperation("提交订单")
    @PostMapping("/submit")
    public Result submit(@RequestBody OrdersSubmitDTO dto) {
        OrderSubmitVO submit = orederService.submit(dto);
        return Result.success(submit);
        }
}
